	  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<?php
		//with the function $_SERVER we assign at the variable location the route where we are now to have a dynamic menu and title
		$location= $_SERVER['SCRIPT_NAME'];
		$location=explode("/", $location);
		$num=count($location);
		if ($location[$num-1]=="importstudents.php"){$page_title = "Import Students";}
		else if ($location[$num-1]=="CreateGroup.php") {$page_title = "Create Group";}
		else if ($location[$num-1]=="ChooseGroup.php") {$page_title = "Choose Group";}
		else if ($location[$num-1]=="Addmarks.php") {$page_title = "Add Marks";}
		else if ($location[$num-1]=="Viewmarks.php") {$page_title = "View Marks";}
		else $page_title = "My Marks";
		echo "<title>$page_title</title>";
	?>
	<meta http-equiv="content-type" content="text/html" charset="utf-8" />
	<LINK href="estilos.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="logotipo">
	<table width="100%">
	<tr>
		<td><? echo "Logged as <b>". $_SESSION['user'] ."</b>"; ?></br></br><a href="index.php">Log out</a></td>
		<td><img src="img/banner.jpg" alt="" /></td>
	</tr>
	</table>
	</div>
	
	<div id="menu">
		<table width="100%" border="5">
		<tr>
			<td width="15%" align="center"><a href="index.php">Logout</a></td>
			<td width="15%" align="center"><a id="Import" href="importstudents.php">Import Students </a></td>
			<td width="15%" align="center"><a id="Create" href="CreateGroup.php">Create Group </a></td>
			<td width="15%" align="center"><a id="Choose" href="ChooseGroup.php">Choose Group </a></td>
			<td width="15%" align="center"><a id="Addmarks" href="Addmarks.php">Add Marks </a></td>
			<td width="15%" align="center"><a id="Viewmarks" href="Viewmarks.php">View Marks </a></td>
		</tr>
		</table>
	</div>
	
	<?
		//with this functions, the color of the sections of the menu change depending on where we are
		if ($location[$num-1]=="importstudents.php"){echo "<script type='text/javascript'> document.getElementById('Import').style.color='White';  </script>";}
		if ($location[$num-1]=="CreateGroup.php"){echo "<script type='text/javascript'> document.getElementById('Create').style.color='White';  </script>";}
		if ($location[$num-1]=="ChooseGroup.php"){echo "<script type='text/javascript'> document.getElementById('Choose').style.color='White';  </script>";}
		if ($location[$num-1]=="Addmarks.php"){echo "<script type='text/javascript'> document.getElementById('Addmarks').style.color='White';  </script>";}
		if ($location[$num-1]=="Viewmarks.php"){echo "<script type='text/javascript'> document.getElementById('Viewmarks').style.color='White';  </script>";}
		
		//with this code, the student view the message depending on the page where he stays
		$path = $_SERVER['SCRIPT_NAME'];
		$path = explode("/",$path);
		$num = count($path);

		if ($path[$num-1] != "Viewmarks.php" && $path[$num-1] != "index.php") 
		{
		echo "
		<br /><br /><br />
		<h1>You don't have permission to access at this page.</h1>
		<br /><br /><br />";

		}


?>
	   